home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / office deutch / INFOPATH.NL-NL / INFLR.CAB / ASSETTRA.XSN_1043 / upgrade.xsl < prev    next >
Extensible Markup Language  |  2006-11-12  |  4KB  |  106 lines

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-10-21T21:12:27" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" version="1.0">
  3.     <xsl:output encoding="UTF-8" method="xml"/>
  4.     <xsl:template match="text() | *[namespace-uri()='http://www.w3.org/1999/xhtml']" mode="RichText">
  5.         <xsl:copy-of select="."/>
  6.     </xsl:template>
  7.     <xsl:template match="/">
  8.         <xsl:copy-of select="processing-instruction() | comment()"/>
  9.         <xsl:choose>
  10.             <xsl:when test="my:assetTracking">
  11.                 <xsl:apply-templates select="my:assetTracking" mode="_0"/>
  12.             </xsl:when>
  13.             <xsl:otherwise>
  14.                 <xsl:variable name="var">
  15.                     <xsl:element name="my:assetTracking"/>
  16.                 </xsl:variable>
  17.                 <xsl:apply-templates select="msxsl:node-set($var)/*" mode="_0"/>
  18.             </xsl:otherwise>
  19.         </xsl:choose>
  20.     </xsl:template>
  21.     <xsl:template match="my:employee" mode="_1">
  22.         <xsl:copy>
  23.             <xsl:element name="my:employeeName">
  24.                 <xsl:copy-of select="my:employeeName/text()[1]"/>
  25.             </xsl:element>
  26.             <xsl:element name="my:employeeDepartment">
  27.                 <xsl:copy-of select="my:employeeDepartment/text()[1]"/>
  28.             </xsl:element>
  29.         </xsl:copy>
  30.     </xsl:template>
  31.     <xsl:template match="my:asset" mode="_3">
  32.         <xsl:copy>
  33.             <xsl:element name="my:assetID">
  34.                 <xsl:copy-of select="my:assetID/text()[1]"/>
  35.             </xsl:element>
  36.             <xsl:element name="my:assetDescription">
  37.                 <xsl:copy-of select="my:assetDescription/text()[1]"/>
  38.             </xsl:element>
  39.             <xsl:element name="my:assetMake">
  40.                 <xsl:copy-of select="my:assetMake/text()[1]"/>
  41.             </xsl:element>
  42.             <xsl:element name="my:assetModel">
  43.                 <xsl:copy-of select="my:assetModel/text()[1]"/>
  44.             </xsl:element>
  45.             <xsl:element name="my:assetSerialNumber">
  46.                 <xsl:copy-of select="my:assetSerialNumber/text()[1]"/>
  47.             </xsl:element>
  48.             <xsl:element name="my:assetAssignedTo">
  49.                 <xsl:copy-of select="my:assetAssignedTo/text()[1]"/>
  50.             </xsl:element>
  51.             <xsl:element name="my:assetDepartment">
  52.                 <xsl:copy-of select="my:assetDepartment/text()[1]"/>
  53.             </xsl:element>
  54.             <xsl:element name="my:assetLocation">
  55.                 <xsl:copy-of select="my:assetLocation/text()[1]"/>
  56.             </xsl:element>
  57.             <xsl:element name="my:assetCategory">
  58.                 <xsl:copy-of select="my:assetCategory/text()[1]"/>
  59.             </xsl:element>
  60.             <xsl:element name="my:assetNotes">
  61.                 <xsl:apply-templates select="my:assetNotes/text() | my:assetNotes/*[namespace-uri()='http://www.w3.org/1999/xhtml']" mode="RichText"/>
  62.             </xsl:element>
  63.         </xsl:copy>
  64.     </xsl:template>
  65.     <xsl:template match="my:assets" mode="_2">
  66.         <xsl:copy>
  67.             <xsl:choose>
  68.                 <xsl:when test="my:asset">
  69.                     <xsl:apply-templates select="my:asset" mode="_3"/>
  70.                 </xsl:when>
  71.                 <xsl:otherwise>
  72.                     <xsl:variable name="var">
  73.                         <xsl:element name="my:asset"/>
  74.                     </xsl:variable>
  75.                     <xsl:apply-templates select="msxsl:node-set($var)/*" mode="_3"/>
  76.                 </xsl:otherwise>
  77.             </xsl:choose>
  78.         </xsl:copy>
  79.     </xsl:template>
  80.     <xsl:template match="my:assetTracking" mode="_0">
  81.         <xsl:copy>
  82.             <xsl:choose>
  83.                 <xsl:when test="my:employee">
  84.                     <xsl:apply-templates select="my:employee[1]" mode="_1"/>
  85.                 </xsl:when>
  86.                 <xsl:otherwise>
  87.                     <xsl:variable name="var">
  88.                         <xsl:element name="my:employee"/>
  89.                     </xsl:variable>
  90.                     <xsl:apply-templates select="msxsl:node-set($var)/*" mode="_1"/>
  91.                 </xsl:otherwise>
  92.             </xsl:choose>
  93.             <xsl:choose>
  94.                 <xsl:when test="my:assets">
  95.                     <xsl:apply-templates select="my:assets[1]" mode="_2"/>
  96.                 </xsl:when>
  97.                 <xsl:otherwise>
  98.                     <xsl:variable name="var">
  99.                         <xsl:element name="my:assets"/>
  100.                     </xsl:variable>
  101.                     <xsl:apply-templates select="msxsl:node-set($var)/*" mode="_2"/>
  102.                 </xsl:otherwise>
  103.             </xsl:choose>
  104.         </xsl:copy>
  105.     </xsl:template>
  106. </xsl:stylesheet>